//
//  Utils.h
//  mUBB
//
//  Created by Cosmin Stirbu on 2/23/13.
//  Copyright (c) 2013 Cosmin Stirbu. All rights reserved.
//

#import <Foundation/Foundation.h>

@interface Utils : NSObject

// Returns a NSDate from string with a given format
+ (NSDate *)dateFromString:(NSString *)dateAsString withFormat:(NSString *)format;

// Returns a string from a date with a given format
+ (NSString *)stringFromDate:(NSDate *)date withFormat:(NSString *)format;

// Returns an UIColor from hex value
+ (UIColor *)colorWithHexString:(NSString *)hexString;

// Display the network activity indicator on the status bar
+ (void)showNetworkActivityIndicator;

// Hide the network activity indicator on the status bar
+ (void)hideNetworkActivityIndicator;

// Customize UIButton with background image, image, text, text color
+ (void)customizeButton:(UIButton *)button withBgImageKey:(NSString *)bgImageKey imageKey:(NSString *)imageKey textKey:(NSString *)textKey textColorKey:(NSString *)textColorKey;

// Customize label with text and text color
+ (void)customizeLabel:(UILabel *)label withTextKey:(NSString *)textKey textColorKey:(NSString *)textColorKey;

// Check if the email as the right format
+ (BOOL)isEmailValid:(NSString *)email;

// Display a loading spinner on the view controller passed as the argument
+ (void)showLoadingOn:(UIViewController *)viewController;

// Hide the loading cove on the passed view controller
+ (void)hideLoadingOn:(UIViewController *)viewController;

// Compares two dates regarding only the month, year and day
+ (NSComparisonResult)date:(NSDate *)date1 compareTo:(NSDate *)date2;

// Creates a date time with the date from the first date and the time from the second
+ (NSDate *)dateTimeFromDate:(NSDate *)date time:(NSDate *)time;

// Checks if a string is a number
+ (BOOL)isNumber:(NSString *)string;

@end
